package com.service;

import java.sql.Date;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.dao.EmployeeDao;
import com.model.Employee;

@Service("employeeService")
@Transactional
public class EmployeeServiceImpl implements EmployeeService {

	@Autowired
	private EmployeeDao employeeDao;
	
	
	public void add(String branch,Employee employee) {
		employeeDao.add(branch,employee);		
	}

	public Employee get(Integer id) {
		return employeeDao.get(id);
	}

	public void delete(Integer id) {
		employeeDao.delete(id);

	}

	public List<Employee> getByDate(Date from,Date to)
	{
		return employeeDao.getByDate(from, to);
	}


	public List<Employee> getAll(int page) {
		return employeeDao.getAll(page);

	}

	public int getNoOfRecords() {
		return employeeDao.getNoOfRecords();
	}

	@Override
	public List<Employee> getAllForUser(String name) {
			return employeeDao.getAllForUser(name);
	}

	@Override
	public List<Employee> getAllForAdmin() {
		return employeeDao.getAllForAdmin();
	}

}
